
import instance from "@/utils/axios"

import { getToken } from "@/utils/token.js"

// 封装登入接口
function userLogin(values) {
    return instance({
        url: '/v1_0/authorizations',
        method: "post",
        data: values
    })
}

export { userLogin }

// 封装获取用户信息接口
function getUserInfo() {
    return instance({
        url: '/v1_0/user/profile',
        method: "get",
    })
}
export { getUserInfo }

// 编辑用户信息
function editUserInfo(data) {
    return instance({
        url: '/v1_0/user/profile',
        method: "patch",
        data: data,
    })
}
export { editUserInfo }

// 编辑用户头像
function editUserPhoto(fd) {
    return instance({
        url: '/v1_0/user/photo',
        method: "patch",
        data: fd,
        headers: {
            Authorization: 'Bearer ' + getToken().token
        }
    })
}
export { editUserPhoto }




